import {defineStore} from "pinia"

interface person  {
    name:string;
    token:string;
    roles:string[]
}

export const userInfoStore = defineStore('userInfo',
    {
    
    state:()=>({
        name:"",
        token:"",
        roles:[""]
    }),

    actions:{
        setUser(p:person){
            this.name = p.name
            this.token = p.token
            this.roles = p.roles
        }
    },

    getters:{
        getToken(state){
            return state.token
        },
        getRoles(state){
            return state.roles
        }
    },
})


